package com.eric.req;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;

/**
 * @description: post 请求基础实体
 * @author: liuBing
 * @create: 2022-12-19 16:38
 **/
@Data
@ApiModel("post 请求基础实体")
public class BasePostReq {

    @NotBlank(message = "请输入id")
    private String id;

    @ApiModelProperty("名称")
    @NotBlank(message = "请输入名称")
    @Length(message = "名称不能超过个 {max} 字符", max = 10)
    private String name;

    @ApiModelProperty("年龄")
    @NotNull(message = "请输入年龄")
    @Range(message = "年龄范围为 {min} 到 {max} 之间", min = 1, max = 100)
    private String age;
}



